{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"className\", \"style\", \"prefix\", \"split\", \"notFoundContent\", \"value\", \"defaultValue\", \"children\", \"options\", \"open\", \"validateSearch\", \"filterOption\", \"onChange\", \"onKeyDown\", \"onKeyUp\", \"onPressEnter\", \"onSearch\", \"onSelect\", \"onFocus\", \"onBlur\", \"transitionName\", \"placement\", \"direction\", \"getPopupContainer\", \"dropdownClassName\"];\nimport classNames from 'classnames';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport toArray from \"rc-util/es/Children/toArray\";\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport warning from \"rc-util/es/warning\";\nimport React, { useEffect, useRef, useState } from 'react';\nimport TextArea from 'rc-textarea';\nimport KeywordTrigger from './KeywordTrigger';\nimport MentionsContext from './MentionsContext';\nimport Option from './Option';\nimport { filterOption as defaultFilterOption, getBeforeSelectionText, getLastMeasureIndex, replaceWithMeasure, setInputSelection, validateSearch as defaultValidateSearch } from './util';\nimport useEffectState from './hooks/useEffectState';\nvar Mentions = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var prefixCls = props.prefixCls,\n    className = props.className,\n    style = props.style,\n    prefix = props.prefix,\n    split = props.split,\n    notFoundContent = props.notFoundContent,\n    value = props.value,\n    defaultValue = props.defaultValue,\n    children = props.children,\n    options = props.options,\n    open = props.open,\n    validateSearch = props.validateSearch,\n    filterOption = props.filterOption,\n    onChange = props.onChange,\n    onKeyDown = props.onKeyDown,\n    onKeyUp = props.onKeyUp,\n    onPressEnter = props.onPressEnter,\n    onSearch = props.onSearch,\n    onSelect = props.onSelect,\n    onFocus = props.onFocus,\n    onBlur = props.onBlur,\n    transitionName = props.transitionName,\n    placement = props.placement,\n    direction = props.direction,\n    getPopupContainer = props.getPopupContainer,\n    dropdownClassName = props.dropdownClassName,\n    restProps = _objectWithoutProperties(props, _excluded);\n  var mergedPrefix = Array.isArray(prefix) ? prefix : [prefix];\n  var mergedProps = _objectSpread(_objectSpread({}, props), {}, {\n    prefix: mergedPrefix\n  });\n  // =============================== Refs ===============================\n  var textareaRef = useRef(null);\n  var measureRef = useRef(null);\n  var getTextArea = function getTextArea() {\n    var _textareaRef$current, _textareaRef$current$;\n    return (_textareaRef$current = textareaRef.current) === null || _textareaRef$current === void 0 ? void 0 : (_textareaRef$current$ = _textareaRef$current.resizableTextArea) === null || _textareaRef$current$ === void 0 ? void 0 : _textareaRef$current$.textArea;\n  };\n  React.useImperativeHandle(ref, function () {\n    var _textareaRef$current4, _textareaRef$current5;\n    return {\n      focus: function focus() {\n        var _textareaRef$current2;\n        return (_textareaRef$current2 = textareaRef.current) === null || _textareaRef$current2 === void 0 ? void 0 : _textareaRef$current2.focus();\n      },\n      blur: function blur() {\n        var _textareaRef$current3;\n        return (_textareaRef$current3 = textareaRef.current) === null || _textareaRef$current3 === void 0 ? void 0 : _textareaRef$current3.blur();\n      },\n      textarea: (_textareaRef$current4 = textareaRef.current) === null || _textareaRef$current4 === void 0 ? void 0 : (_textareaRef$current5 = _textareaRef$current4.resizableTextArea) === null || _textareaRef$current5 === void 0 ? void 0 : _textareaRef$current5.textArea\n    };\n  });\n  // ============================== State ===============================\n  var _useState = useState(false),\n    _useState2 = _slicedToArray(_useState, 2),\n    measuring = _useState2[0],\n    setMeasuring = _useState2[1];\n  var _useState3 = useState(''),\n    _useState4 = _slicedToArray(_useState3, 2),\n    measureText = _useState4[0],\n    setMeasureText = _useState4[1];\n  var _useState5 = useState(''),\n    _useState6 = _slicedToArray(_useState5, 2),\n    measurePrefix = _useState6[0],\n    setMeasurePrefix = _useState6[1];\n  var _useState7 = useState(0),\n    _useState8 = _slicedToArray(_useState7, 2),\n    measureLocation = _useState8[0],\n    setMeasureLocation = _useState8[1];\n  var _useState9 = useState(0),\n    _useState10 = _slicedToArray(_useState9, 2),\n    activeIndex = _useState10[0],\n    setActiveIndex = _useState10[1];\n  var _useState11 = useState(false),\n    _useState12 = _slicedToArray(_useState11, 2),\n    isFocus = _useState12[0],\n    setIsFocus = _useState12[1];\n  // ============================== Value ===============================\n  var _useMergedState = useMergedState('', {\n      defaultValue: defaultValue,\n      value: value\n    }),\n    _useMergedState2 = _slicedToArray(_useMergedState, 2),\n    mergedValue = _useMergedState2[0],\n    setMergedValue = _useMergedState2[1];\n  // =============================== Open ===============================\n  useEffect(function () {\n    // Sync measure div top with textarea for rc-trigger usage\n    if (measuring && measureRef.current) {\n      measureRef.current.scrollTop = getTextArea().scrollTop;\n    }\n  }, [measuring]);\n  var _React$useMemo = React.useMemo(function () {\n      if (open) {\n        if (process.env.NODE_ENV !== 'production') {\n          warning(false, '`open` of Mentions is only used for debug usage. Do not use in you production.');\n        }\n        for (var i = 0; i < mergedPrefix.length; i += 1) {\n          var curPrefix = mergedPrefix[i];\n          var index = mergedValue.lastIndexOf(curPrefix);\n          if (index >= 0) {\n            return [true, '', curPrefix, index];\n          }\n        }\n      }\n      return [measuring, measureText, measurePrefix, measureLocation];\n    }, [open, measuring, mergedPrefix, mergedValue, measureText, measurePrefix, measureLocation]),\n    _React$useMemo2 = _slicedToArray(_React$useMemo, 4),\n    mergedMeasuring = _React$useMemo2[0],\n    mergedMeasureText = _React$useMemo2[1],\n    mergedMeasurePrefix = _React$useMemo2[2],\n    mergedMeasureLocation = _React$useMemo2[3];\n  // ============================== Option ==============================\n  var getOptions = React.useCallback(function (targetMeasureText) {\n    var list;\n    if (options && options.length > 0) {\n      list = options.map(function (item) {\n        var _item$key;\n        return _objectSpread(_objectSpread({}, item), {}, {\n          key: (_item$key = item === null || item === void 0 ? void 0 : item.key) !== null && _item$key !== void 0 ? _item$key : item.value\n        });\n      });\n    } else {\n      list = toArray(children).map(function (_ref) {\n        var optionProps = _ref.props,\n          key = _ref.key;\n        return _objectSpread(_objectSpread({}, optionProps), {}, {\n          label: optionProps.children,\n          key: key || optionProps.value\n        });\n      });\n    }\n    return list.filter(function (option) {\n      /** Return all result if `filterOption` is false. */\n      if (filterOption === false) {\n        return true;\n      }\n      return filterOption(targetMeasureText, option);\n    });\n  }, [children, options, filterOption]);\n  var mergedOptions = React.useMemo(function () {\n    return getOptions(mergedMeasureText);\n  }, [getOptions, mergedMeasureText]);\n  // ============================= Measure ==============================\n  // Mark that we will reset input selection to target position when user select option\n  var onSelectionEffect = useEffectState();\n  var startMeasure = function startMeasure(nextMeasureText, nextMeasurePrefix, nextMeasureLocation) {\n    setMeasuring(true);\n    setMeasureText(nextMeasureText);\n    setMeasurePrefix(nextMeasurePrefix);\n    setMeasureLocation(nextMeasureLocation);\n    setActiveIndex(0);\n  };\n  var stopMeasure = function stopMeasure(callback) {\n    setMeasuring(false);\n    setMeasureLocation(0);\n    setMeasureText('');\n    onSelectionEffect(callback);\n  };\n  // ============================== Change ==============================\n  var triggerChange = function triggerChange(nextValue) {\n    setMergedValue(nextValue);\n    onChange === null || onChange === void 0 ? void 0 : onChange(nextValue);\n  };\n  var onInternalChange = function onInternalChange(_ref2) {\n    var nextValue = _ref2.target.value;\n    triggerChange(nextValue);\n  };\n  var selectOption = function selectOption(option) {\n    var _getTextArea;\n    var _option$value = option.value,\n      mentionValue = _option$value === void 0 ? '' : _option$value;\n    var _replaceWithMeasure = replaceWithMeasure(mergedValue, {\n        measureLocation: mergedMeasureLocation,\n        targetText: mentionValue,\n        prefix: mergedMeasurePrefix,\n        selectionStart: (_getTextArea = getTextArea()) === null || _getTextArea === void 0 ? void 0 : _getTextArea.selectionStart,\n        split: split\n      }),\n      text = _replaceWithMeasure.text,\n      selectionLocation = _replaceWithMeasure.selectionLocation;\n    triggerChange(text);\n    stopMeasure(function () {\n      // We need restore the selection position\n      setInputSelection(getTextArea(), selectionLocation);\n    });\n    onSelect === null || onSelect === void 0 ? void 0 : onSelect(option, mergedMeasurePrefix);\n  };\n  // ============================= KeyEvent =============================\n  // Check if hit the measure keyword\n  var onInternalKeyDown = function onInternalKeyDown(event) {\n    var which = event.which;\n    onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);\n    // Skip if not measuring\n    if (!mergedMeasuring) {\n      return;\n    }\n    if (which === KeyCode.UP || which === KeyCode.DOWN) {\n      // Control arrow function\n      var optionLen = mergedOptions.length;\n      var offset = which === KeyCode.UP ? -1 : 1;\n      var newActiveIndex = (activeIndex + offset + optionLen) % optionLen;\n      setActiveIndex(newActiveIndex);\n      event.preventDefault();\n    } else if (which === KeyCode.ESC) {\n      stopMeasure();\n    } else if (which === KeyCode.ENTER) {\n      // Measure hit\n      event.preventDefault();\n      if (!mergedOptions.length) {\n        stopMeasure();\n        return;\n      }\n      var option = mergedOptions[activeIndex];\n      selectOption(option);\n    }\n  };\n  /**\n   * When to start measure:\n   * 1. When user press `prefix`\n   * 2. When measureText !== prevMeasureText\n   *  - If measure hit\n   *  - If measuring\n   *\n   * When to stop measure:\n   * 1. Selection is out of range\n   * 2. Contains `space`\n   * 3. ESC or select one\n   */\n  var onInternalKeyUp = function onInternalKeyUp(event) {\n    var key = event.key,\n      which = event.which;\n    var target = event.target;\n    var selectionStartText = getBeforeSelectionText(target);\n    var _getLastMeasureIndex = getLastMeasureIndex(selectionStartText, mergedPrefix),\n      measureIndex = _getLastMeasureIndex.location,\n      nextMeasurePrefix = _getLastMeasureIndex.prefix;\n    // If the client implements an onKeyUp handler, call it\n    onKeyUp === null || onKeyUp === void 0 ? void 0 : onKeyUp(event);\n    // Skip if match the white key list\n    if ([KeyCode.ESC, KeyCode.UP, KeyCode.DOWN, KeyCode.ENTER].indexOf(which) !== -1) {\n      return;\n    }\n    if (measureIndex !== -1) {\n      var nextMeasureText = selectionStartText.slice(measureIndex + nextMeasurePrefix.length);\n      var validateMeasure = validateSearch(nextMeasureText, mergedProps);\n      var matchOption = !!getOptions(nextMeasureText).length;\n      if (validateMeasure) {\n        if (key === nextMeasurePrefix || key === 'Shift' || mergedMeasuring || nextMeasureText !== mergedMeasureText && matchOption) {\n          startMeasure(nextMeasureText, nextMeasurePrefix, measureIndex);\n        }\n      } else if (mergedMeasuring) {\n        // Stop if measureText is invalidate\n        stopMeasure();\n      }\n      /**\n       * We will trigger `onSearch` to developer since they may use for async update.\n       * If met `space` means user finished searching.\n       */\n      if (onSearch && validateMeasure) {\n        onSearch(nextMeasureText, nextMeasurePrefix);\n      }\n    } else if (mergedMeasuring) {\n      stopMeasure();\n    }\n  };\n  var onInternalPressEnter = function onInternalPressEnter(event) {\n    if (!mergedMeasuring && onPressEnter) {\n      onPressEnter(event);\n    }\n  };\n  // ============================ Focus Blur ============================\n  var focusRef = useRef();\n  var onInternalFocus = function onInternalFocus(event) {\n    window.clearTimeout(focusRef.current);\n    if (!isFocus && event && onFocus) {\n      onFocus(event);\n    }\n    setIsFocus(true);\n  };\n  var onInternalBlur = function onInternalBlur(event) {\n    focusRef.current = window.setTimeout(function () {\n      setIsFocus(false);\n      stopMeasure();\n      onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);\n    }, 0);\n  };\n  var onDropdownFocus = function onDropdownFocus() {\n    onInternalFocus();\n  };\n  var onDropdownBlur = function onDropdownBlur() {\n    onInternalBlur();\n  };\n  // ============================== Render ==============================\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(prefixCls, className),\n    style: style\n  }, /*#__PURE__*/React.createElement(TextArea, _extends({\n    ref: textareaRef,\n    value: mergedValue\n  }, restProps, {\n    onChange: onInternalChange,\n    onKeyDown: onInternalKeyDown,\n    onKeyUp: onInternalKeyUp,\n    onPressEnter: onInternalPressEnter,\n    onFocus: onInternalFocus,\n    onBlur: onInternalBlur\n  })), mergedMeasuring && /*#__PURE__*/React.createElement(\"div\", {\n    ref: measureRef,\n    className: \"\".concat(prefixCls, \"-measure\")\n  }, mergedValue.slice(0, mergedMeasureLocation), /*#__PURE__*/React.createElement(MentionsContext.Provider, {\n    value: {\n      notFoundContent: notFoundContent,\n      activeIndex: activeIndex,\n      setActiveIndex: setActiveIndex,\n      selectOption: selectOption,\n      onFocus: onDropdownFocus,\n      onBlur: onDropdownBlur\n    }\n  }, /*#__PURE__*/React.createElement(KeywordTrigger, {\n    prefixCls: prefixCls,\n    transitionName: transitionName,\n    placement: placement,\n    direction: direction,\n    options: mergedOptions,\n    visible: true,\n    getPopupContainer: getPopupContainer,\n    dropdownClassName: dropdownClassName\n  }, /*#__PURE__*/React.createElement(\"span\", null, mergedMeasurePrefix))), mergedValue.slice(mergedMeasureLocation + mergedMeasurePrefix.length)));\n});\nMentions.defaultProps = {\n  prefixCls: 'rc-mentions',\n  prefix: '@',\n  split: ' ',\n  validateSearch: defaultValidateSearch,\n  filterOption: defaultFilterOption,\n  notFoundContent: 'Not Found',\n  rows: 1\n};\nMentions.Option = Option;\nexport default Mentions;","map":{"version":3,"names":["_extends","_slicedToArray","_objectSpread","_objectWithoutProperties","_excluded","classNames","useMergedState","toArray","KeyCode","warning","React","useEffect","useRef","useState","TextArea","KeywordTrigger","MentionsContext","Option","filterOption","defaultFilterOption","getBeforeSelectionText","getLastMeasureIndex","replaceWithMeasure","setInputSelection","validateSearch","defaultValidateSearch","useEffectState","Mentions","forwardRef","props","ref","prefixCls","className","style","prefix","split","notFoundContent","value","defaultValue","children","options","open","onChange","onKeyDown","onKeyUp","onPressEnter","onSearch","onSelect","onFocus","onBlur","transitionName","placement","direction","getPopupContainer","dropdownClassName","restProps","mergedPrefix","Array","isArray","mergedProps","textareaRef","measureRef","getTextArea","_textareaRef$current","_textareaRef$current$","current","resizableTextArea","textArea","useImperativeHandle","_textareaRef$current4","_textareaRef$current5","focus","_textareaRef$current2","blur","_textareaRef$current3","textarea","_useState","_useState2","measuring","setMeasuring","_useState3","_useState4","measureText","setMeasureText","_useState5","_useState6","measurePrefix","setMeasurePrefix","_useState7","_useState8","measureLocation","setMeasureLocation","_useState9","_useState10","activeIndex","setActiveIndex","_useState11","_useState12","isFocus","setIsFocus","_useMergedState","_useMergedState2","mergedValue","setMergedValue","scrollTop","_React$useMemo","useMemo","process","env","NODE_ENV","i","length","curPrefix","index","lastIndexOf","_React$useMemo2","mergedMeasuring","mergedMeasureText","mergedMeasurePrefix","mergedMeasureLocation","getOptions","useCallback","targetMeasureText","list","map","item","_item$key","key","_ref","optionProps","label","filter","option","mergedOptions","onSelectionEffect","startMeasure","nextMeasureText","nextMeasurePrefix","nextMeasureLocation","stopMeasure","callback","triggerChange","nextValue","onInternalChange","_ref2","target","selectOption","_getTextArea","_option$value","mentionValue","_replaceWithMeasure","targetText","selectionStart","text","selectionLocation","onInternalKeyDown","event","which","UP","DOWN","optionLen","offset","newActiveIndex","preventDefault","ESC","ENTER","onInternalKeyUp","selectionStartText","_getLastMeasureIndex","measureIndex","location","indexOf","slice","validateMeasure","matchOption","onInternalPressEnter","focusRef","onInternalFocus","window","clearTimeout","onInternalBlur","setTimeout","onDropdownFocus","onDropdownBlur","createElement","concat","Provider","visible","defaultProps","rows"],"sources":["/data/messenger.client/node_modules/rc-mentions/es/Mentions.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"className\", \"style\", \"prefix\", \"split\", \"notFoundContent\", \"value\", \"defaultValue\", \"children\", \"options\", \"open\", \"validateSearch\", \"filterOption\", \"onChange\", \"onKeyDown\", \"onKeyUp\", \"onPressEnter\", \"onSearch\", \"onSelect\", \"onFocus\", \"onBlur\", \"transitionName\", \"placement\", \"direction\", \"getPopupContainer\", \"dropdownClassName\"];\nimport classNames from 'classnames';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport toArray from \"rc-util/es/Children/toArray\";\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport warning from \"rc-util/es/warning\";\nimport React, { useEffect, useRef, useState } from 'react';\nimport TextArea from 'rc-textarea';\nimport KeywordTrigger from './KeywordTrigger';\nimport MentionsContext from './MentionsContext';\nimport Option from './Option';\nimport { filterOption as defaultFilterOption, getBeforeSelectionText, getLastMeasureIndex, replaceWithMeasure, setInputSelection, validateSearch as defaultValidateSearch } from './util';\nimport useEffectState from './hooks/useEffectState';\nvar Mentions = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var prefixCls = props.prefixCls,\n    className = props.className,\n    style = props.style,\n    prefix = props.prefix,\n    split = props.split,\n    notFoundContent = props.notFoundContent,\n    value = props.value,\n    defaultValue = props.defaultValue,\n    children = props.children,\n    options = props.options,\n    open = props.open,\n    validateSearch = props.validateSearch,\n    filterOption = props.filterOption,\n    onChange = props.onChange,\n    onKeyDown = props.onKeyDown,\n    onKeyUp = props.onKeyUp,\n    onPressEnter = props.onPressEnter,\n    onSearch = props.onSearch,\n    onSelect = props.onSelect,\n    onFocus = props.onFocus,\n    onBlur = props.onBlur,\n    transitionName = props.transitionName,\n    placement = props.placement,\n    direction = props.direction,\n    getPopupContainer = props.getPopupContainer,\n    dropdownClassName = props.dropdownClassName,\n    restProps = _objectWithoutProperties(props, _excluded);\n  var mergedPrefix = Array.isArray(prefix) ? prefix : [prefix];\n  var mergedProps = _objectSpread(_objectSpread({}, props), {}, {\n    prefix: mergedPrefix\n  });\n  // =============================== Refs ===============================\n  var textareaRef = useRef(null);\n  var measureRef = useRef(null);\n  var getTextArea = function getTextArea() {\n    var _textareaRef$current, _textareaRef$current$;\n    return (_textareaRef$current = textareaRef.current) === null || _textareaRef$current === void 0 ? void 0 : (_textareaRef$current$ = _textareaRef$current.resizableTextArea) === null || _textareaRef$current$ === void 0 ? void 0 : _textareaRef$current$.textArea;\n  };\n  React.useImperativeHandle(ref, function () {\n    var _textareaRef$current4, _textareaRef$current5;\n    return {\n      focus: function focus() {\n        var _textareaRef$current2;\n        return (_textareaRef$current2 = textareaRef.current) === null || _textareaRef$current2 === void 0 ? void 0 : _textareaRef$current2.focus();\n      },\n      blur: function blur() {\n        var _textareaRef$current3;\n        return (_textareaRef$current3 = textareaRef.current) === null || _textareaRef$current3 === void 0 ? void 0 : _textareaRef$current3.blur();\n      },\n      textarea: (_textareaRef$current4 = textareaRef.current) === null || _textareaRef$current4 === void 0 ? void 0 : (_textareaRef$current5 = _textareaRef$current4.resizableTextArea) === null || _textareaRef$current5 === void 0 ? void 0 : _textareaRef$current5.textArea\n    };\n  });\n  // ============================== State ===============================\n  var _useState = useState(false),\n    _useState2 = _slicedToArray(_useState, 2),\n    measuring = _useState2[0],\n    setMeasuring = _useState2[1];\n  var _useState3 = useState(''),\n    _useState4 = _slicedToArray(_useState3, 2),\n    measureText = _useState4[0],\n    setMeasureText = _useState4[1];\n  var _useState5 = useState(''),\n    _useState6 = _slicedToArray(_useState5, 2),\n    measurePrefix = _useState6[0],\n    setMeasurePrefix = _useState6[1];\n  var _useState7 = useState(0),\n    _useState8 = _slicedToArray(_useState7, 2),\n    measureLocation = _useState8[0],\n    setMeasureLocation = _useState8[1];\n  var _useState9 = useState(0),\n    _useState10 = _slicedToArray(_useState9, 2),\n    activeIndex = _useState10[0],\n    setActiveIndex = _useState10[1];\n  var _useState11 = useState(false),\n    _useState12 = _slicedToArray(_useState11, 2),\n    isFocus = _useState12[0],\n    setIsFocus = _useState12[1];\n  // ============================== Value ===============================\n  var _useMergedState = useMergedState('', {\n      defaultValue: defaultValue,\n      value: value\n    }),\n    _useMergedState2 = _slicedToArray(_useMergedState, 2),\n    mergedValue = _useMergedState2[0],\n    setMergedValue = _useMergedState2[1];\n  // =============================== Open ===============================\n  useEffect(function () {\n    // Sync measure div top with textarea for rc-trigger usage\n    if (measuring && measureRef.current) {\n      measureRef.current.scrollTop = getTextArea().scrollTop;\n    }\n  }, [measuring]);\n  var _React$useMemo = React.useMemo(function () {\n      if (open) {\n        if (process.env.NODE_ENV !== 'production') {\n          warning(false, '`open` of Mentions is only used for debug usage. Do not use in you production.');\n        }\n        for (var i = 0; i < mergedPrefix.length; i += 1) {\n          var curPrefix = mergedPrefix[i];\n          var index = mergedValue.lastIndexOf(curPrefix);\n          if (index >= 0) {\n            return [true, '', curPrefix, index];\n          }\n        }\n      }\n      return [measuring, measureText, measurePrefix, measureLocation];\n    }, [open, measuring, mergedPrefix, mergedValue, measureText, measurePrefix, measureLocation]),\n    _React$useMemo2 = _slicedToArray(_React$useMemo, 4),\n    mergedMeasuring = _React$useMemo2[0],\n    mergedMeasureText = _React$useMemo2[1],\n    mergedMeasurePrefix = _React$useMemo2[2],\n    mergedMeasureLocation = _React$useMemo2[3];\n  // ============================== Option ==============================\n  var getOptions = React.useCallback(function (targetMeasureText) {\n    var list;\n    if (options && options.length > 0) {\n      list = options.map(function (item) {\n        var _item$key;\n        return _objectSpread(_objectSpread({}, item), {}, {\n          key: (_item$key = item === null || item === void 0 ? void 0 : item.key) !== null && _item$key !== void 0 ? _item$key : item.value\n        });\n      });\n    } else {\n      list = toArray(children).map(function (_ref) {\n        var optionProps = _ref.props,\n          key = _ref.key;\n        return _objectSpread(_objectSpread({}, optionProps), {}, {\n          label: optionProps.children,\n          key: key || optionProps.value\n        });\n      });\n    }\n    return list.filter(function (option) {\n      /** Return all result if `filterOption` is false. */\n      if (filterOption === false) {\n        return true;\n      }\n      return filterOption(targetMeasureText, option);\n    });\n  }, [children, options, filterOption]);\n  var mergedOptions = React.useMemo(function () {\n    return getOptions(mergedMeasureText);\n  }, [getOptions, mergedMeasureText]);\n  // ============================= Measure ==============================\n  // Mark that we will reset input selection to target position when user select option\n  var onSelectionEffect = useEffectState();\n  var startMeasure = function startMeasure(nextMeasureText, nextMeasurePrefix, nextMeasureLocation) {\n    setMeasuring(true);\n    setMeasureText(nextMeasureText);\n    setMeasurePrefix(nextMeasurePrefix);\n    setMeasureLocation(nextMeasureLocation);\n    setActiveIndex(0);\n  };\n  var stopMeasure = function stopMeasure(callback) {\n    setMeasuring(false);\n    setMeasureLocation(0);\n    setMeasureText('');\n    onSelectionEffect(callback);\n  };\n  // ============================== Change ==============================\n  var triggerChange = function triggerChange(nextValue) {\n    setMergedValue(nextValue);\n    onChange === null || onChange === void 0 ? void 0 : onChange(nextValue);\n  };\n  var onInternalChange = function onInternalChange(_ref2) {\n    var nextValue = _ref2.target.value;\n    triggerChange(nextValue);\n  };\n  var selectOption = function selectOption(option) {\n    var _getTextArea;\n    var _option$value = option.value,\n      mentionValue = _option$value === void 0 ? '' : _option$value;\n    var _replaceWithMeasure = replaceWithMeasure(mergedValue, {\n        measureLocation: mergedMeasureLocation,\n        targetText: mentionValue,\n        prefix: mergedMeasurePrefix,\n        selectionStart: (_getTextArea = getTextArea()) === null || _getTextArea === void 0 ? void 0 : _getTextArea.selectionStart,\n        split: split\n      }),\n      text = _replaceWithMeasure.text,\n      selectionLocation = _replaceWithMeasure.selectionLocation;\n    triggerChange(text);\n    stopMeasure(function () {\n      // We need restore the selection position\n      setInputSelection(getTextArea(), selectionLocation);\n    });\n    onSelect === null || onSelect === void 0 ? void 0 : onSelect(option, mergedMeasurePrefix);\n  };\n  // ============================= KeyEvent =============================\n  // Check if hit the measure keyword\n  var onInternalKeyDown = function onInternalKeyDown(event) {\n    var which = event.which;\n    onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);\n    // Skip if not measuring\n    if (!mergedMeasuring) {\n      return;\n    }\n    if (which === KeyCode.UP || which === KeyCode.DOWN) {\n      // Control arrow function\n      var optionLen = mergedOptions.length;\n      var offset = which === KeyCode.UP ? -1 : 1;\n      var newActiveIndex = (activeIndex + offset + optionLen) % optionLen;\n      setActiveIndex(newActiveIndex);\n      event.preventDefault();\n    } else if (which === KeyCode.ESC) {\n      stopMeasure();\n    } else if (which === KeyCode.ENTER) {\n      // Measure hit\n      event.preventDefault();\n      if (!mergedOptions.length) {\n        stopMeasure();\n        return;\n      }\n      var option = mergedOptions[activeIndex];\n      selectOption(option);\n    }\n  };\n  /**\n   * When to start measure:\n   * 1. When user press `prefix`\n   * 2. When measureText !== prevMeasureText\n   *  - If measure hit\n   *  - If measuring\n   *\n   * When to stop measure:\n   * 1. Selection is out of range\n   * 2. Contains `space`\n   * 3. ESC or select one\n   */\n  var onInternalKeyUp = function onInternalKeyUp(event) {\n    var key = event.key,\n      which = event.which;\n    var target = event.target;\n    var selectionStartText = getBeforeSelectionText(target);\n    var _getLastMeasureIndex = getLastMeasureIndex(selectionStartText, mergedPrefix),\n      measureIndex = _getLastMeasureIndex.location,\n      nextMeasurePrefix = _getLastMeasureIndex.prefix;\n    // If the client implements an onKeyUp handler, call it\n    onKeyUp === null || onKeyUp === void 0 ? void 0 : onKeyUp(event);\n    // Skip if match the white key list\n    if ([KeyCode.ESC, KeyCode.UP, KeyCode.DOWN, KeyCode.ENTER].indexOf(which) !== -1) {\n      return;\n    }\n    if (measureIndex !== -1) {\n      var nextMeasureText = selectionStartText.slice(measureIndex + nextMeasurePrefix.length);\n      var validateMeasure = validateSearch(nextMeasureText, mergedProps);\n      var matchOption = !!getOptions(nextMeasureText).length;\n      if (validateMeasure) {\n        if (key === nextMeasurePrefix || key === 'Shift' || mergedMeasuring || nextMeasureText !== mergedMeasureText && matchOption) {\n          startMeasure(nextMeasureText, nextMeasurePrefix, measureIndex);\n        }\n      } else if (mergedMeasuring) {\n        // Stop if measureText is invalidate\n        stopMeasure();\n      }\n      /**\n       * We will trigger `onSearch` to developer since they may use for async update.\n       * If met `space` means user finished searching.\n       */\n      if (onSearch && validateMeasure) {\n        onSearch(nextMeasureText, nextMeasurePrefix);\n      }\n    } else if (mergedMeasuring) {\n      stopMeasure();\n    }\n  };\n  var onInternalPressEnter = function onInternalPressEnter(event) {\n    if (!mergedMeasuring && onPressEnter) {\n      onPressEnter(event);\n    }\n  };\n  // ============================ Focus Blur ============================\n  var focusRef = useRef();\n  var onInternalFocus = function onInternalFocus(event) {\n    window.clearTimeout(focusRef.current);\n    if (!isFocus && event && onFocus) {\n      onFocus(event);\n    }\n    setIsFocus(true);\n  };\n  var onInternalBlur = function onInternalBlur(event) {\n    focusRef.current = window.setTimeout(function () {\n      setIsFocus(false);\n      stopMeasure();\n      onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);\n    }, 0);\n  };\n  var onDropdownFocus = function onDropdownFocus() {\n    onInternalFocus();\n  };\n  var onDropdownBlur = function onDropdownBlur() {\n    onInternalBlur();\n  };\n  // ============================== Render ==============================\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: classNames(prefixCls, className),\n    style: style\n  }, /*#__PURE__*/React.createElement(TextArea, _extends({\n    ref: textareaRef,\n    value: mergedValue\n  }, restProps, {\n    onChange: onInternalChange,\n    onKeyDown: onInternalKeyDown,\n    onKeyUp: onInternalKeyUp,\n    onPressEnter: onInternalPressEnter,\n    onFocus: onInternalFocus,\n    onBlur: onInternalBlur\n  })), mergedMeasuring && /*#__PURE__*/React.createElement(\"div\", {\n    ref: measureRef,\n    className: \"\".concat(prefixCls, \"-measure\")\n  }, mergedValue.slice(0, mergedMeasureLocation), /*#__PURE__*/React.createElement(MentionsContext.Provider, {\n    value: {\n      notFoundContent: notFoundContent,\n      activeIndex: activeIndex,\n      setActiveIndex: setActiveIndex,\n      selectOption: selectOption,\n      onFocus: onDropdownFocus,\n      onBlur: onDropdownBlur\n    }\n  }, /*#__PURE__*/React.createElement(KeywordTrigger, {\n    prefixCls: prefixCls,\n    transitionName: transitionName,\n    placement: placement,\n    direction: direction,\n    options: mergedOptions,\n    visible: true,\n    getPopupContainer: getPopupContainer,\n    dropdownClassName: dropdownClassName\n  }, /*#__PURE__*/React.createElement(\"span\", null, mergedMeasurePrefix))), mergedValue.slice(mergedMeasureLocation + mergedMeasurePrefix.length)));\n});\nMentions.defaultProps = {\n  prefixCls: 'rc-mentions',\n  prefix: '@',\n  split: ' ',\n  validateSearch: defaultValidateSearch,\n  filterOption: defaultFilterOption,\n  notFoundContent: 'Not Found',\n  rows: 1\n};\nMentions.Option = Option;\nexport default Mentions;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAo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